<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.infodms.dms.common.Constant" %>
<%@ page import="com.infodms.dms.po.TmBrandPO" %>
<%@ page import="com.infodms.dms.common.FileConstant"%>
<%@ page import="java.util.*" %> 
<%
	String contextPath = request.getContextPath();
	List list = null;
	if(request.getAttribute("list") != null){
		list = (LinkedList)request.getAttribute("list");
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<script type="text/javascript" src="<%=FileConstant.regionJsUrl%>"></script>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="<%=contextPath%>/style/content.css" rel="stylesheet" type="text/css" />
	<link href="<%=contextPath %>/style/calendar.css" rel="stylesheet" type="text/css" />
	<link href="<%=contextPath %>/style/page-info.css" rel="stylesheet" type="text/css" />
	<link href="<%=contextPath%>/style/dtree1.css" rel="stylesheet"	type="text/css" />
<jsp:include page="${path}/common/jsp_head_new.jsp" />
<title>公司维护</title>
<style>
	.img{ border:none}
</style>
<script type="text/javascript">
var dept_tree_url = "<%=contextPath%>/sysmng/usemng/SgmSysUser/initOrgTree.json";
</script>
</head>

<body onunload='javascript:destoryPrototype()' onload="genLocSel('txt1','txt2','');loadcalendar();">
	<div class="wbox">
	<div class="navigation">
		<img src="<%=contextPath%>/img/nav.gif" />&nbsp;当前位置： 系统管理 &gt; 组织管理 &gt; 公司维护
	</div>
	<form id="fm">
		<input type="hidden" name="tree_root_id" id="tree_root_id" value=""/>
		<table class="table_query" border="0" style="border:1px solid #DAE0EE">
			<th colspan="6"><img class="nav" src="<%=contextPath%>/img/subNav.gif" />&nbsp;公司信息</th>
			<tr>
				<td class="table_info_3col_label_5Letter" nowrap="nowrap" >公司代码：
				</td>
				<td class="table_info_3col_input"  nowrap="nowrap">
					<input class="middle_txt"  type="text" name="DLR_CODE" id="DLR_CODE" datatype="0,is_docNumber,12"/>
				</td>
				 </tr>
			<tr>
      			<td class="table_info_3col_label_5Letter" nowrap="nowrap">公司名称：
				</td>
			  	<td class="table_info_3col_input" nowrap="nowrap" colspan="5">
					<input name="DLR_NAME"  type="text" class="long_txt"  style="width:406px;" id="DLR_NAME" datatype="0,is_null,<%=Constant.Length_Check_Char_30 %>"/>
				</td>
		    </tr>
			
			<tr>
				<td class="table_info_3col_label_5Letter" nowrap="nowrap">公司简称：
				</td>
				<td class="table_info_3col_input"  nowrap="nowrap" >
					<input class="middle_txt"  type="text" name="DLRNAMEFORSHORT" id="DLRNAMEFORSHORT" datatype="0,is_null,<%=Constant.Length_Check_Char_15 %>"/>
				</td>
				</tr>
			
			<tr>
			<td class="table_info_3col_label_5Letter" nowrap="nowrap">公司类型：
				</td>
				<td class="table_info_3col_input"  nowrap="nowrap">
				<script type="text/javascript"> 
				writeItemValue('<%=Constant.COMPANY_TYPE_DEALER%>');
				</script>
				</td>
				
			</tr>
			<tr>
		    	<td class="table_info_3col_label_5Letter" nowrap="nowrap" >省份：
				</td>
				<td class="table_info_3col_input"  nowrap="nowrap">
					<select class="min_sel" id="txt1" name="PROVINCE" datatype="0,is_null,200" onchange="_genCity(this,'txt2')"></select>
				</td>
				</tr>
			<tr>
				<td class="table_info_3col_label_5Letter" nowrap="nowrap">城市：</td>
				<td class="table_info_3col_input"  nowrap="nowrap" >
					<select class="min_sel" name="CITY" id="txt2"></select>
				</td>
				
		    </tr>
			<tr>
				<td class="table_info_3col_label_5Letter" nowrap="nowrap">联系电话：
				</td>
				<td class="table_info_3col_input"  nowrap="nowrap" >
					<input class="middle_txt"  type="text" name="CONT_TEL" id="CONT_TEL" datatype="0,is_phone,19" maxlength="15"/>
				</td>
			</tr>
			
			
			<tr>
				
		    	<td class="table_info_3col_label_5Letter" nowrap="nowrap">邮编：
				</td>
				<td class="table_info_3col_input"  nowrap="nowrap">
					<input type="text" class="short_txt" name="ZIP_CODE" id="ZIP_CODE" datatype="0,is_digit,<%=Constant.Length_Check_Char_6 %>" maxlength="6"/>
				</td>
				</tr>
				<tr>
				
				<td class="table_info_3col_label_5Letter" nowrap="nowrap">传真：
				</td>
				<td class="table_info_3col_input"  nowrap="nowrap">
					<input class="middle_txt"  type="text" name="FAX" id="FAX" datatype="1,is_phone,19" maxlength="15" id="FAX"/>
				</td>			
		    </tr>
		    <tr>
				<td class="table_info_3col_label_5Letter" nowrap="nowrap"  >详细地址：
				</td>
				<td class="table_info_3col_input" nowrap="nowrap" colspan="5">
					<input type="text" class="long_txt"  style="width:406px;" name="DETL_ADDR" id="DETL_ADDR" datatype="1,is_address,<%=Constant.Length_Check_Char_30 %>"/>
				</td>
			</tr>
			<tr>
				<td class="table_info_3col_label_5Letter" nowrap="nowrap">状态：
				</td>
				<td class="table_info_3col_input"  nowrap="nowrap">
					<script type="text/javascript"> genSelBox("DLR_STAT",<%=Constant.STATUS%>,"",false,"min_sel","");</script><font color="red">&nbsp;*</font>
		    	</td>
		    </tr>
			
			<tr>
				<td colspan="6" align="center">
					<input class="normal_btn" type="button" value="确 定" onclick="confirmAdd();" name="addBtn" id="addBtn"/>
					<input class="normal_btn" type="button" value="返 回" onclick="goBack();"/>		</td>	
			</tr>
		</table>
	</form>	
<div id="loader" style='position:absolute;z-index:200;background:#FFCC00;padding:1px;top:4px;display:none;display: none;'></div>
	</div>
<script type="text/javascript">
validateConfig.isOnBlur = false;
	

	function confirmAdd(){
		if(submitForm('fm')){
			sendAjax('<%=request.getContextPath()%>/sysmng/orgmng/DlrInfoMng/addCompanyInfo.json',showResult,'fm');
		}
	}
	function showResult(json){
		if(json.ACTION_RESULT == '1'){
			goBack();
		//	MyConfirm("新增成功！点击确认返回查询界面或者点击左边菜单进入其他功能！","window.location.href = '<%=request.getContextPath()%>/sysmng/orgmng/DlrInfoMng/queryAllDlrInfo.do'");
		}else if(json.ACTION_RESULT == '2'){
			MyAlert("新增失败！请确认新增的经销商信息（经销商代码）已经存在！");
		}
	}
	function goBack(){
		window.location.href = "<%=contextPath%>/sysmng/orgmng/DlrInfoMng/queryAllDlrInfo.do";
	}
</script>
</body>
</html>
